/*
 ============================================================================
 Page	     : 201-202
 Name        : break.c
 Date	     : 20210404
 Author      : Hbue 18060333
 Copyright   : Your copyright notice
 Description : 使用break退出循环
 ============================================================================
 */

#include <stdio.h>

int main(void)
{
	float length = 0;
	float width = 0;

	printf("Enter the length of the rectangle(q to quit):\n");
	while(scanf("%f", &length) == 1)
	{
		printf("Length = %0.2f:\n", length);
		printf("Enter its width:\n");
		if(scanf("%f", &width) != 1)
		{
			break;
		}
		printf("Width = %0.2f:\n", width);
		printf("Area = %0.2f:\n", length * width);
		printf("Enter the length of the rectangle(q to quit):\n");
	}
	printf("Done");

	return 0;
}

